﻿using CarAppDto.Base;
using CarAppDto.CarType.CarTypeDtos;
using FluentValidation;

namespace CarAppDto.CarType.CarTypeVersionDtos
{
    public class ReqUpdateCarTypeVersionValidator : AbstractValidator<ReqUpdateCarTypeVersion>
    {
        /// <summary>
        /// 校验规则写到校验类的构造方法中
        /// </summary>
        public ReqUpdateCarTypeVersionValidator()
        {
            RuleFor(x => x.Id).NotEmpty().Length(1, 36);
            RuleFor(x => x.BrandId).NotEmpty().Length(1, 36);
            RuleFor(x => x.VehicleSeriesId).NotEmpty().Length(1, 36);
            RuleFor(x => x.CarTypeId).NotEmpty().Length(1, 36);
            RuleFor(x => x.Version).NotEmpty().Length(1, 20);
            RuleFor(x => x.Code).NotEmpty().Length(1, 20);
        }
    }

    public class ReqUpdateCarTypeVersion : BaseUpdateModel
    {
        /// <summary>
        /// 车型版本代码
        /// </summary>
        public string? Code { get; set; }
        /// <summary>
        /// 所属品牌代码
        /// </summary>
        public string? BrandId { get; set; }

        /// <summary>
        /// 所属车系代码（车系ID）
        /// </summary>
        public string? VehicleSeriesId { get; set; }

        /// <summary>
        /// 所属车型代码
        /// </summary>
        public string? CarTypeId { get; set; }

        /// <summary>
        /// 车型版本
        /// </summary>
        public string? Version { get; set; }

        /// <summary>
        /// 销售名称
        /// </summary>
        public string? SalesName { get; set; }


        /// <summary>
        /// 自定义字段1
        /// </summary>
        public string? CustomFields1 { get; set; }

        /// <summary>
        /// 自定义字段2
        /// </summary>
        public string? CustomFields2 { get; set; }

        /// <summary>
        /// 自定义字段3
        /// </summary>
        public string? CustomFields3 { get; set; }

        /// <summary>
        /// 自定义字段4
        /// </summary>
        public string? CustomFields4 { get; set; }

        /// <summary>
        /// 自定义字段5
        /// </summary>
        public string? CustomFields5 { get; set; }

        /// <summary>
        /// 自定义字段6
        /// </summary>
        public string? CustomFields6 { get; set; }

        /// <summary>
        /// 自定义字段7
        /// </summary>
        public string? CustomFields7 { get; set; }

        /// <summary>
        /// 自定义字段8
        /// </summary>
        public string? CustomFields8 { get; set; }

        /// <summary>
        /// 自定义字段9
        /// </summary>
        public string? CustomFields9 { get; set; }

        /// <summary>
        /// 自定义字段10
        /// </summary>
        public string? CustomFields10 { get; set; }

        /// <summary>
        /// 车型版本配件信息
        /// </summary>
       public List<CarPartsCarTypeVersion> CarPartsCarTypeVersionList { get; set; } = new List<CarPartsCarTypeVersion>();
    }
}
